<?php
namespace Mob \ Controller;

use Think \ Controller;
use Think \ Hook;
//分享控制器
class ShareController extends BaseController {

     public function newShareFormWx()
     {

     $Uid = get_uid();
     $title = I('get.shareTitle',null,'string');
     $url = I('get.shareUrl',null,false);
     $imgUrl = I('get.shareUrl',null,false);
     $desc = I('get.shareDesc',null,'string');
     $mode = I('get.shareMode',1,'int');
     $type = I('get.shareType','link','string');
     $businessID = I('get.businessID',null,'int');
     $businessType = I('get.businessType',null,'int');
     $url = urldecode($url);//把url解析操作
     $title='youhuer';
     $url = 'http://www.youhuer.com/index.php?s=/mob/activity/actdetails/actId/A201610071759494850.html';
     $imgUrl='http://www.youhuer.com/Uploads/Avatar/1683/oEc6EuHzsqXOj_64_64.jpg';
     $desc='youhuer desc!';
     $businessID='2016100821273101';
     $businessType=1;

     $share = D('Share');
     $serialno = $share->creatorShare($Uid,$mode,$url,$title,$imgUrl,$businessID,$businessType,$type);
     $share_info = array('title'=>$title,'url'=>$url,'imgUrl'=>$imgUrl,'desc'=>$desc,'mode'=>$mode,'businessID'=>$businessID,'businessType'=>$businessType,'shareSerialno'=>$serialno);
     $wxCommon = D('WxCommon');
     $sign=$wxCommon->get_js_sdk();
     $this->assign('signPackage',$sign);
     $this->assign('share_info',$share_info);
     $this->display();
     }
     public function operaterResult()
     {
     $serialno = I('post.shareSerialno',null,'int');
     $shareFlg = I('post.shareFlg',null,'int');
     $share = D('Share');
     $result = $share->updateShareResult($serialno,$shareFlg);
     if($result)
     {
      $data = array('status'=>1,'msg'=>'操作成功!');
     }
     $this->ajaxReturn($data);
     }






}



